//
//  SMAccountViewController.m
//  lishiminOC
//
//  Created by p2p on 16/10/11.
//  Copyright © 2016年 p2p. All rights reserved.
//

#import "SMAccountViewController.h"


@interface SMAccountViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic,strong)UITableView *tableView;
@end

@implementation SMAccountViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupUI];
}

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];

}

- (void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
//    [SMShared sharedManager].flag = 0;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}
#pragma mark - 设置视图界面
- (void)setupUI{
    UITableView *tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreenWidth], [UIScreen mainScreenHeight]) style:UITableViewStylePlain];
    tableView.dataSource = self;
    tableView.delegate = self;
    [tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
    tableView.backgroundColor = [UIColor greenColor];
    self.tableView = tableView;
    [self.view addSubview:tableView];
}
#pragma mark - UITableViewDataSource

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 4;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.section == 0) {
        UITableViewCell *cell = [[NSClassFromString(@"SMAccountHeardCell") alloc]init];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.backgroundColor = [UIColor grayColor];
        return cell;
        
    } else if(indexPath.section == 1){
        UITableViewCell *cell = [[NSClassFromString(@"SMAccountCollectionCell") alloc]init];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.backgroundColor = [UIColor grayColor];
        return cell;
    } else if(indexPath.section == 2){
        UITableViewCell *cell = [[NSClassFromString(@"SMAccountScrollCell") alloc]init];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.backgroundColor = [UIColor grayColor];
        return cell;
    } else {
        UITableViewCell *cell = [[NSClassFromString(@"SMBusinessRecordCell") alloc]init];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.backgroundColor = [UIColor grayColor];
        return cell;
    }
    
    
}
#pragma mark - UITableViewDelegate

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.section == 0) {
        return 115;
    } else if (indexPath.section == 1){
        return 75;
    } else if (indexPath.section == 2){
        return 122;
    } else {
        return 135;
    }
    
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 15;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    if (indexPath.section == 0) {
        
        
    } else if (indexPath.section == 1){
        
    } else if (indexPath.section == 2){
        
    } else {
        
        
    }
}


@end
